package com.cskaoyan;

import com.alibaba.druid.pool.DruidDataSourceFactory;
import org.junit.Test;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;


/**
 * 创建日期: 2022/08/30 17:37
 *
 * @author ciggar
 */
public class UserTest {

    @Test
    public void testInsertUser(){
        System.out.println("testInsertUser...");
    }


    @Test
    public void testRuntime() throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException {


        // 1. 注册驱动
        Class.forName("com.mysql.jdbc.Driver");

        // 2. 获取连接
        Connection connection = DriverManager.getConnection("","","");

        // 3. 获取Statement对象
        Statement statement = connection.createStatement();

        // 4. 解析结果集

        // 5. 关闭资源


    }


    @Test
    public void testUpdateUser() throws SQLException {

//        Driver driver = new Driver();

        System.out.println("11111");

    }

    public static void main(String[] args) throws Exception {

        DataSource dataSource = DruidDataSourceFactory.createDataSource(new Properties());


    }
}
